<?php
namespace addon\cms\validate;
use app\common\validate\ValidateBase;
class Message extends ValidateBase
{
    // 验证规则
    protected $rule = [
        'name'                 => 'require',
        'email'                => 'require|email',
        'message'              => 'require|token'
    ];

    // 验证提示
    protected $message = [
        'name.require'         => '姓名不能为空',
        'email.require'        => '邮箱不能为空',
        'email.email'          => '邮箱格式不正确',
        'message.require'      => '留言不能为空',
    ];

    // 应用场景
    protected $scene = [
        'add'  =>  ['name','email','message'],
    ];
}